
#ifndef _IGS_STM32_IAP_H
#define _IGS_STM32_IAP_H

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "stm32f2xx.h"
#include "flash_if.h"

typedef  void (*pFunction)(void);

#define APPINFO_ADDRESS (uint32_t)0x08004000

#define Data_Len	1024

enum {
	CMD_Return_Ver	= 0xC1,
	CMD_RunPROG			=0xC2,
	CMD_EraseAPP		=0xC3,
	CMD_DataHead		=0xC4,	//Data(1K)...checksum
	CMD_Program			=0xC5,
	CMD_EndPROG			=0xC6,	//all checksum
	
	CMD_ACK		= 0xA3,
	CMD_NACK	= 0xA4,
};

uint8_t Prog_function(void);
void Flash_Lock_RDP(void);
void Flash_UnLock_RDP(void);
void LED_Polling(uint8_t mode);

#endif
